import { Catch, httpError, MidwayHttpError } from "@midwayjs/core/dist";
import { Context } from "@midwayjs/koa/dist";

@Catch(httpError.NotFoundError)
export class NotFoundFilter {
  // 404 错误会到这里
  async catch(err: MidwayHttpError, ctx: Context) {
    ctx.redirect("/404.html");
  }
}
